{config_load file="index.conf"}
{include file="inc/doctype.tpl"}

<head>
    <title>My messages</title>
    {include file="inc/include.tpl"}
</head>

<body>

{include file="inc/logo.tpl"}
{include file="inc/global_menu.tpl"}

{include file="profile/inc/data.tpl"}<br />
<div><strong>My messages</strong></div><br />

{if $course == 'from'}<a href="/profile/messages/">Input</a>{else}<strong>Input</strong>{/if} 
{if $course == 'to'}<a href="/profile/messages/output/">Output</a>{else}<strong>Output</strong>{/if}

{if sizeof($messages_list)}
    <div>
	{foreach from=$messages_list item=item}
	    <a href="/another/index/{$item.user_id}/">{$item.user_login}</a> {$item.message_created}<br />
        {if !$item.message_read}<strong>{/if}
            <a href="/profile/message/{$item.message_id}/{$item.user_id}/">{$item.message_title|escape}</a>
        {if !$item.message_read}</strong>{/if}<br />
	    {$item.message_content|truncate:"80"}...<br />
	    {if $course == 'to'}<a href="/another/send/{$item.user_id}/">Answer</a> <a href="/profile/delmessage/{$item.message_id}/">Delete</a>{/if}<hr />
	{/foreach}
	</div><br />
	<div>
    <!-- Paging -->
    {foreach from=$paging item=item key=key}
        {if $page == $key}{$item}{else}<a href="{$sys_action_path}/{if $course == 'from'}output/{else}input/{/if}{if 1 != $item}{$key}/{/if}">{$item}</a>{/if} 
    {/foreach}
    <!--// Paging -->
    </div>
{else}
    <p>Empty</p>
{/if}

{include file="profile/inc/return.tpl"}

</body>

</html>  